'use strict';

/**
 * Created by twer on 15/3/5.
 */
var photo = angular.module('photo');

photo.factory('AlbumListService', ['$resource', 'RootPathConstant', function ($resource, RootPathConstant) {
    return $resource(RootPathConstant + '/photo/album/owner/:ownerId?countPerPage=:countPerPage&offset=:offset', {},
        {query: {method: 'GET', isArray: false}}
    );
}]);

photo.factory('AlbumService', ['$resource', 'RootPathConstant', function ($resource, RootPathConstant) {
    return $resource(RootPathConstant + '/photo/album/:albumId', {},
        {
            query: {method: 'GET', isArray: false},
            save:  {method: 'POST'},
            remove: {method: 'DELETE', isArray: false}
        }
    );
}]);

photo.factory('AlbumModalService', ['btfModal', function (btfModal) {
    return btfModal({
        controller: 'AlbumManagementCtrl',
        controllerAs: 'albumModal',
        templateUrl: 'views/photo/album_management.html'
    })
}]);
